package com.pureut.order.dubbo;

import com.pureut.order.service.PurchaseOrderService;
import com.sale.order.api.RemotePurchaseOrderService;
import com.sale.order.api.vo.UpdatePurchaseOrderDataVo;
import lombok.RequiredArgsConstructor;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.stereotype.Service;

/**
 * 采购订单服务实现
 */
@RequiredArgsConstructor
@DubboService
@Service
public class RemotePurchaseOrderServiceImpl implements RemotePurchaseOrderService {

    private final PurchaseOrderService purchaseOrderService;

    /**
     * 采购入库回传采购订单数据
     * @param updatePurchaseOrderDataVo
     * @return
     */
    @Override
    public boolean updateOrderData(UpdatePurchaseOrderDataVo updatePurchaseOrderDataVo) {

        return purchaseOrderService.updateOrderData(updatePurchaseOrderDataVo);
    }

    /**
     * 委外入库回传数据
     * @param updatePurchaseOrderDataVo
     * @return
     */
    @Override
    public boolean updateOrderDataSub(UpdatePurchaseOrderDataVo updatePurchaseOrderDataVo) {
        return purchaseOrderService.updateOrderDataSub(updatePurchaseOrderDataVo);
    }

    /**
     * 采购订单退货重量累加
     * @param updatePurchaseOrderDataVo
     * @return
     */
    @Override
    public boolean updateSalesReturn(UpdatePurchaseOrderDataVo updatePurchaseOrderDataVo) {

        return purchaseOrderService.updateSalesReturn(updatePurchaseOrderDataVo);
    }

    /**
     * 采购订单退货重量扣除
     * @param updatePurchaseOrderDataVo
     * @return
     */
    @Override
    public boolean updateDeductSalesReturn(UpdatePurchaseOrderDataVo updatePurchaseOrderDataVo) {
        return purchaseOrderService.updateDeductSalesReturn(updatePurchaseOrderDataVo);
    }
}
